package com.xhdd;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

import java.net.InetAddress;
import java.net.UnknownHostException;

@SpringBootApplication
public class App {
    public static void main(String[] args) throws UnknownHostException {
        ConfigurableApplicationContext application = SpringApplication.run(App.class);
        Environment env = application.getEnvironment();
        String port = env.getProperty("server.port");
        if (port == null) {
            port = "8080";
        }
        String address = InetAddress.getLocalHost().getHostAddress();
        System.out.printf("\n http://%s:%s/doc.html\n", address, port);


    }
}